/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __FILE_RESOURCE_H__
#define __FILE_RESOURCE_H__

#include "Resource.h"
#include <NoCopy.h>
#include <filesystem/String.hpp>
#include <filesystem/File.h>

namespace liba
{
namespace resource
{

class File : public Resource, private Nocopy
{
	filesystem::File impl;
public:
	explicit File(const filesystem::String & name)
		:	impl( name, filesystem::File::READ )
	{}
	virtual ~File()
	{}
	virtual bool is_valid()const
	{
		return impl.is_valid();
	}
	virtual int read(void * data, int count)
	{
		return impl.read( data, count );
	}
	virtual int skip(int count)
	{
		return impl.skip( count );
	}
	virtual int get_size()const
	{
		return impl.get_size();
	}
	virtual int get_position()const
	{
		return impl.get_position();
	}
	virtual void reset(int position)
	{
		return impl.reset( position );
	}
};

} // namespace resource
} // namespace liba

using namespace liba;

#endif //__FILE_RESOURCE_H__

